package com.homework.work02;

import java.util.Scanner;

public class Work02_06 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个3位数: ");
        int n = scanner.nextInt();
        if (n == ((n/100)*(n/100)*(n/100)+(n/10%10)*(n/10%10)*(n/10%10)+(n%10)*(n%10)*(n%10))){
            System.out.println("这是一个水仙数");
        }else {
            System.out.println("这不是一个水仙数");
        }

        for (int i = 100; i <=999 ; i++) {
            if (i == ((i/100)*(i/100)*(i/100)+(i/10%10)*(i/10%10)*(i/10%10)+(i%10)*(i%10)*(i%10))){
                System.out.println("这是一个水仙数="+i);
            }
        }
    }
}
